package com.cloud.pole.rabbit;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/*
*2019年5月18日
*cloud-weixin
*author:frank-chen
*/
@Component
public class Receiver {
	
    @RabbitHandler
    @RabbitListener(queues = "hello")
    public void process(String msg) {
        System.out.println("Receiver:"+msg);
        try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    
//    @RabbitHandler
//    @RabbitListener(queues = "hello01")
//    public void process01(String msg) {
//        System.out.println("Receiver:"+msg);
//    }
}